home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / str.exe / README < prev    next >
Text File  |  1993-04-13  |  10KB  |  240 lines

  1. Copyright (c) 1993 by Roy S. Woll 
  2.  
  3. Class "str", Version 2.1    3/1/93
  4.  
  5. You may distribute and sell any executable which results from using this code
  6. in your applications.  You may redistribute this source freely as long as you
  7. leave all files in their original form, including the copyright notice as is.
  8. You may NOT include any SOURCE code of this software with any program that is
  9. sold. 
  10.  
  11. I would sincerely welcome any comments/criticism/ideas you might have about
  12. the str or the regular expression class.
  13.  
  14. If you use the product, please register by sending $15.00 to 
  15. Roy S. Woll, 1032 Summerplace Dr., San Jose, CA 95122.  You will receive
  16. an enhanced version of the class, more extensive documentation, 
  17. and updates as they are made available.
  18.  
  19.  
  20.            ------------------------------------------
  21.            |                                        |
  22.            | Roy S. Woll                            |
  23.            | 1032 Summerplace Dr.                   |
  24.            | San Jose, CA 95122                     |
  25.            |                                        |
  26.            | CompuServe : 76207,2541                |
  27.            |                                        |
  28.            | Phone: (408) 778-2000 x4518  (day)     |
  29.            |        (408) 293-5893        (evening) |
  30.            |                                        |
  31.            ------------------------------------------
  32.  
  33.  
  34. In addition those of you who register will receive a more powerful
  35. version of the regular expression class that includes context-sensitive
  36. regular expressions.  For instance you will easily be able to search or 
  37. replace a specific portion (flagged by '@') of a regular expression.
  38.  
  39.             
  40.             regX employeeX("Pay to the order of @[A-Za-z\\s]+$");
  41.             str paycheck("Payroll\nPay to the order of Roy S. Woll\n$50,000");
  42.             str employee;
  43.  
  44.             paycheck.search(employeeX,  &employee); 
  45.             paycheck.replace(employeeX,  "a lucky person");
  46.  
  47.        //
  48.        // After executing the above code, employee will contain the
  49.        // name of the person following the text "Pay to the order of ".
  50.        //
  51.        // employee = "Roy S. Woll"
  52.        // paycheck = "Payroll\nPay to the order of lucky person\n$50,000"
  53.        //   
  54.  
  55.  
  56. ------------------------------------------------------------------------------
  57.  
  58.           FILES:  THE FOLLOWING FILES ARE INCLUDED.
  59.  
  60.           str.doc        Documentation file for str class.
  61.  
  62.           str.h          Interface file for str class
  63.           regX.h         Interface file for regular expression class
  64.           regXimp.h      Interface file used only for implementation of regX
  65.           dynstream.h    Interface file for dynstream class
  66.           bcstr.h        Interface file for BCstr class.  BCstr is compatible
  67.                          with the Borland object-based container classes.
  68.                          It is derived from str.
  69.  
  70.           str.cpp        Implementation file for str class
  71.           regX.cpp       Implementation file for regular expression class
  72.           dynstream.cpp  Implementation file for dynstream class
  73.           match.cpp      Regular expression compiling and searching routines
  74.           strsearch.cpp  Member functions relating to search/replace
  75.           bcstr.cpp      Implementation file for BCstr class
  76.           strcmp.cpp     Non-ansi string routines used by str class.  Add
  77.                          this to your library if your system does not have
  78.                          these (stricmp, strnicmp, strupr, strlwr).
  79.  
  80.           grep.cpp       Demo program for "str" class, supporting 
  81.                          file searching of regular expression matches.
  82.                          Supports wildcard file specifications, case 
  83.                          sensitivity, line numbers, etc.)
  84.  
  85.           makefile       This program defines how to build str.lib
  86.           readme         Brief overview
  87.  
  88.  
  89. ------------------------------------------------------------------------------
  90.  
  91. INSTALLATION AND USE:  
  92. ---------------------
  93.  
  94.             STR.LIB
  95.             -------
  96.             Type "make" to compile the source and create a library called
  97.             str.lib   If you wish to place the object files in your own 
  98.             library, insert the .obj files into your library.  You may 
  99.             also want to place "str.h", and "regular.h" into your default 
  100.             include path.  Bcstr.h is provided for those who wish to use 
  101.             the Borland object-based container classes to store str's.
  102.  
  103.             If you are using Turbo C++ instead of Borland C++, edit the
  104.             makefile and substitute "TCC" for "BCC".
  105.  
  106.             Unix, Vax-Vms, and some other systems may also need to add
  107.             strcmp.obj to the library.  This module defines non-ansi string 
  108.             routines used by str class.  Add this to your library if your 
  109.             system does not have these (stricmp, strnicmp, strupr, strlwr).
  110.  
  111.  
  112.             GREP
  113.             ----
  114.             Type "make grep" to create the executable for grep.  
  115.             Grep is included as a demonstration program for the str class.
  116.             It supports searching of literal and regular expression 
  117.             within files.  Wildcard file specifications, case sensitivity,
  118.             line numbers, etc. are all supported.  The implementatin uses 
  119.             only around 1 page of code, which demostrates how natural coding 
  120.             is when using the regular expression capabilities of the string 
  121.             class.  
  122.  
  123.  
  124.             UPGRADING
  125.             ---------
  126.             If you are upgrading from version 1, then you will need to
  127.             recompile all .cpp files that use the str class.  This must be
  128.             done since str.h has changed.  You also will need to change
  129.             occurances of pad or strip to use the global versions.  This must
  130.             be done since the member functions pad and strip now modify their
  131.             object.  See section "Whats changed in 2.00".
  132.  
  133.  
  134.             USING
  135.             -----
  136.             You will need to include <str.h>, "str.h" in order to use class
  137.             str.  If you also wish to use regular expressions include
  138.             <regX.h>, "regX.h".  Header files "dynstream.h" and
  139.             "regximp.h" are strictly for implementation. and as such are
  140.             separated into other header file.  You should never reference them
  141.             unless you wish to modify their implementation, or derive a new
  142.             class from them.
  143.  
  144.             
  145. ------------------------------------------------------------------------------
  146.  
  147. WHATS DIFFERENT ABOUT VERSION 2.0 - 2.1
  148. ---------------------------------------
  149.  
  150.  
  151.           WHATS DIFFERENT ABOUT VERSION 2.1
  152.           ---------------------------------
  153.  
  154.           Version 2.1 extends regular expression support to include context
  155.           sensitive regular expressions.  See section on regular expressions
  156.           for more details.
  157.  
  158.  
  159.           WHATS CHANGED IN 2.02 and 2.11
  160.           ------------------------------
  161.           Friend operator >> for reading in strings now directly uses the
  162.           string buffer, so as to remove the 256 character limit.
  163.  
  164.           Grep now supports files in other drives and directories.
  165.  
  166.           Optimizations to efficiency in str::_assign which is used
  167.           by many str member functions.
  168.  
  169.           Regular expression character sets can now contain octal characters.
  170.             
  171.           Fix - Member function "remove" now transfers only necessary 
  172.                 characters.  May have caused Windows application error
  173.                 previously.
  174.  
  175.  
  176.           WHATS CHANGED IN 2.01
  177.           ---------------------
  178.  
  179.            This version supports compatibility with Turbo C++.  Previous
  180.            versions would fail to compile due to Turbo C++'s incorrect
  181.            handling of nested classes.
  182.  
  183.           WHATS NEW IN 2.00
  184.           -----------------
  185.  
  186.            1. Searching and replacing of character strings and regular
  187.